package com.gxa.community.core.pojo.domain.goodsdo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 商品信息表
 * </p>
 *
 * @author gxa
 * @since 2022-07-18
 */
@TableName("goods_info")
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel(value = "GoodsInfo对象", description = "商品信息表")
public class GoodsInfo implements Serializable {

    private static final long serialVersionUID = 1L;
    @NotNull(message = "主键id不能为空",groups = {edit.class})
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("商品编号")
    private String nos;
    @NotEmpty(message = "商品名称不能为空",groups = {add.class})
    @ApiModelProperty("商品名称")
    private String name;

    @ApiModelProperty("商品描述")
    private String tips;
    @NotNull(message = "商品分类id不能为空",groups = {add.class})
    @ApiModelProperty("商品分类id")
    private Integer classId;
    @NotNull(message = "商品标签id不能为空",groups = {add.class})
    @ApiModelProperty("商品标签id")
    private Integer tagId;

    @ApiModelProperty("商品品牌id")
    private Integer brandId;

    @ApiModelProperty("商品规格 (specification太长啦)")
    private String size;

    @ApiModelProperty("生产日期")
    private Long productionDate;

    @ApiModelProperty("保质期 (6个月)")
    private String shelfLife;

    @ApiModelProperty("存储方式 (4℃冷藏)")
    private String storageMethod;
    @NotNull(message = "库存不能为空",groups = {add.class})
    @ApiModelProperty("库存")
    private Integer num;
//    @NotEmpty(message = "原价不能为空",groups = {add.class})
    @ApiModelProperty("原价")
    private BigDecimal originalPrice;
//    @NotEmpty(message = "销售价不能为空",groups = {add.class})
    @ApiModelProperty("销售价")
    private BigDecimal actualPrice;

    @ApiModelProperty("限购数量 默认为0不限购")
    private Integer limits;

    @ApiModelProperty("佣金   佣金类型为 2 时取值范围 0-100, 计算时应除以100, 为 3 时即为佣金金额")
    private double commission;

    @ApiModelProperty("1品类(分类)佣金的10%  2佣金百分比 3固定佣金")
    private Integer commissionType;

    @ApiModelProperty("多张用'|'分隔, 第一张为商品头图")
    private String pic;

    @ApiModelProperty("商品详情 (富文本)")
    private String details;
    @NotNull(message = "商品状态不能为空",groups = {add.class})
    @ApiModelProperty("商品状态 1启用 2禁用")
    private Integer status;


    /**
     * 定义分组类
     */
    public interface add{

    }
    //修改分组
    public interface edit{

    }

}
